﻿namespace XYS.Core.Models;

/// <summary>
/// 只有Id 的DTO
/// </summary>
public class IDDTO
{
    /// <summary>
    /// id
    /// </summary>
    public virtual long Id { get; set; }
}

/// <summary>
/// Id + name 的 DTO
/// </summary>
public class IDNameDTO : IDDTO
{
    /// <summary>
    /// name
    /// </summary>
    public virtual string Name { get; set; }
}

/// <summary>
/// id集合
/// </summary>
public class IDSDTO
{
    /// <summary>
    /// id集合
    /// </summary>
    public virtual IEnumerable<long> Ids { get; set; }
}

/// <summary>
/// 键值对 DTO
/// </summary>
/// <typeparam name="T"></typeparam>
public class KeyValueDTO<T>
{
    /// <summary>
    /// 键
    /// </summary>
    public virtual string Key { get; set; }
    /// <summary>
    /// 值
    /// </summary>
    public virtual T Value { get; set; }
}
/// <summary>
/// 键值对 DTO
/// </summary>
public class KeyValueDTO<TKey, TValue>
{
    /// <summary>
    /// 键
    /// </summary>
    public virtual TKey Key { get; set; }
    /// <summary>
    /// 值
    /// </summary>
    public virtual TValue Value { get; set; }
}

/// <summary>
/// 有Id的树形结构 DTO
/// </summary>
/// <typeparam name="T"></typeparam>
public class TreeDTO<T> : IDDTO
{
    /// <summary>
    /// 标题
    /// </summary>
    public virtual string Title { get; set; }

    /// <summary>
    /// 值
    /// </summary>
    public virtual T Value { get; set; }

    /// <summary>
    /// 子集
    /// </summary>
    public virtual TreeDTO<T> children { get; set; }
}

/// <summary>
/// 下拉框数据
/// </summary>
public class DropDTO
{
    /// <summary>
    /// 展示文案
    /// </summary>
    public virtual string Label { get; set; }
    /// <summary>
    /// 值
    /// </summary>
    public virtual string Value { get; set; }
}

/// <summary>
/// 下拉框数据
/// </summary>
/// <typeparam name="TLabel"></typeparam>
/// <typeparam name="TValue"></typeparam>
public class DropDTO<TLabel, TValue>
{
    /// <summary>
    /// 展示文案
    /// </summary>
    public virtual TLabel Label { get; set; }
    /// <summary>
    /// 值
    /// </summary>
    public virtual TValue Value { get; set; }
}


/// <summary>
/// 分页查询下拉框数据 入参
/// </summary>
public class PageDropRequest : PageRequest
{
    /// <summary>
    /// 关键字
    /// </summary>
    public string Keyword { get; set; }
}